package cn.edu.cxcyzx.entity;

import java.io.Serializable;
import java.text.DateFormat;
import java.text.ParseException;
import java.text.SimpleDateFormat;
import java.util.Date;

public class Room_use implements Serializable{

	/**
	 * 
	 */
	private static final long serialVersionUID = 5964019460262757652L;
	
	private int id;
	private String roomId;
	private int projectId;
	private Date check_date;
	private int check_time;//检查的时间段：1：9:00~10:00；2：16:00~17:00；3：19:00~20:00
	
	private int member_num;//实到人数
	public Room_use(){}
	
	public Room_use(String roomId, int projectId, Date check_date,
			int check_time, int member_num) {
		super();
		this.roomId = roomId;
		this.projectId = projectId;
		DateFormat dateformet=new SimpleDateFormat("yyyy-MM-dd");
		try {
			this.check_date = dateformet.parse(dateformet.format(check_date));
		} catch (ParseException e) {
			// TODO Auto-generated catch block
			e.printStackTrace();
		}
		this.check_time = check_time;
		this.member_num = member_num;
	}

	public int getId() {
		return id;
	}

	public void setId(int id) {
		this.id = id;
	}

	public String getRoomId() {
		return roomId;
	}

	public void setRoomId(String roomId) {
		this.roomId = roomId;
	}

	public int getProjectId() {
		return projectId;
	}

	public void setProjectId(int projectId) {
		this.projectId = projectId;
	}

	public Date getCheck_date() {
		DateFormat format=new SimpleDateFormat("yyyy-MM-dd");
		Date date=null;
		try {
			date = format.parse(format.format(check_date));
		} catch (ParseException e) {
			// TODO Auto-generated catch block
			e.printStackTrace();
		}
		return date;
		
	}

	public void setCheck_date(Date check_date) {
		DateFormat dateformet=new SimpleDateFormat("yyyy-MM-dd");
		try {
			this.check_date = dateformet.parse(dateformet.format(check_date));
		} catch (ParseException e) {
			// TODO Auto-generated catch block
			e.printStackTrace();
		}
	}

	public int getCheck_time() {
		return check_time;
	}

	public void setCheck_time(int check_time) {
		this.check_time = check_time;
	}

	public int getMember_num() {
		return member_num;
	}

	public void setMember_num(int member_num) {
		this.member_num = member_num;
	}

	@Override
	public String toString() {
		return "Room_use [id=" + id + ", roomId=" + roomId + ", projectId="
				+ projectId + ", check_date=" + check_date + ", check_time="
				+ check_time + ", member_num=" + member_num + "]";
	}
	
	

}
